<form action="" method="post">
<?php echo $this->form()->hidden('referer', $this->referer) . "\n";?>
<table class="list form oauth">
	<tr>
		<th colspan="2"><?php echo $this->language('第三方帐号');?></th>
		<th><?php echo $this->language('ACCESS TOKEN');?></th>
		<th class="time"><?php echo $this->language('验证时间');?></th>
		<th class="time"><?php echo $this->language('最后登录');?></th>
		<th class="narrow"></th>
	</tr>
	<?php
	$lang = (string) $this->language()->getName();
	foreach(new system_setting_oauth() AS $oauth) {
		if(!in_array($lang, $oauth->getLanguage())) continue;
		$id = strtolower($oauth->getKey());
		$auth = isset($this->list[$oauth->getKey()]) ? $this->list[$oauth->getKey()] : false;
	?>
	<tr>
		<td class="icon"><i class="<?php echo $id;?>"><?php echo $oauth->getKey();?></i></td>
		<td>
			<b><a href="<?php echo $oauth->getUrl();?>" target="_blank" style="font-size:14px;color:#aaa;"><?php echo $oauth->getTitle();?></a></b><br/>
			<?php if($auth) { ?>
			<code><?php echo $this->language('已验证');?></code>
			<?php } else { ?>
			<code><a href="<?php echo $this->url('account/oauth', array('name' => $id));?>"><?php echo $this->language('现在去验证');?>»</a></code>
			<?php } ?>
		</td>
		<td class="key">
			<?php if($auth) { ?>
			<?php echo $this->form()->text('', $auth->getAccessToken(), array('size' => '50', 'readonly' => 'readonly'));?>
			<code><?php echo $this->language('过期时间');?>: <b class="time"><?php echo $this->date($auth->getExpiredtime());?></b></code>
			<?php } ?>
		</td>
		<td class="time"><?php echo ($auth ? $this->date($auth->getCreationtime()) : '-');?></td>
		<td class="time"><?php echo ($auth ? $this->date($auth->getModifiedtime()) : '-');?></td>
		<td></td>
	</tr>
	<?php } ?>
</table>
</form>